using System.Collections.Generic;
using XmlObjects.Types.CCNet.SourceControl;
using XmlObjects.Types.CCNet.Tasks;
using XmlObjects.Types.CCNet.Triggers;

namespace XmlObjects.Types.CCNet
{
	[Serializeable("project")]
	public class CCNetProject
	{
		private string name;
		private int modificationDelaySeconds;
		private SourceControlBlock sourceControlBlock;
		private List<Task> tasks;

		[Property("name")]
		public string Name
		{
			get { return name; }
			set { name = value; }
		}

		[Property("modificationDelaySeconds")]
		public int ModificationDelaySeconds
		{
			get { return modificationDelaySeconds; }
			set { modificationDelaySeconds = value; }
		}

		private List<Trigger> triggers;

		[Property("triggers/*")]
		[SubType("intervalTrigger", typeof(IntervalTrigger))]
		[SubType("filterTrigger", typeof(FilterTrigger))]
		public List<Trigger> Triggers
		{
			get { return triggers; }
			set { triggers = value; }
		}

//		[Property("sourceControl", FindSubTypeBy = "@type")]
//		[SubType("nullSourceControlBlock", typeof(SourceControlBlock), IsDefault = true)]
//		[SubType("subversion", typeof(SubversionSourceControlBlock))]
//		public SourceControlBlock SourceControlBlock
//		{
//			get { return sourceControlBlock; }
//			set { sourceControlBlock = value; }
//		}
	}
}